package handler

import (
	"6-17yk/client/client"
	"6-17yk/client/request"
	"6-17yk/client/response"
	"6-17yk/common/proto/user"
	"github.com/gin-gonic/gin"
)

func InstitutionList(c *gin.Context) {
	var data request.InstitutionList
	err := c.ShouldBind(&data)
	if err != nil {
		response.ResponseError(c, err.Error())
		return
	}
	list, err := client.InstitutionList(c, &user.InstitutionListReq{
		Page:            int64(data.Page),
		Size:            int64(data.Size),
		InstitutionName: data.InstitutionName,
	})
	if err != nil {
		response.ResponseError(c, err.Error())
		return
	}
	response.ResponseSuccess(c, list)
}
